package com.tofine.smarthome.fragment;


import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.tofine.smarthome.R;
import com.tofine.smarthome.base.BaseFragment;

import butterknife.ButterKnife;

/**
 * @author ddMax
 * @since 2016/4/25
 * 说明：设置碎片类
 */
public class SettingsFragment extends BaseFragment {
    public static final String TAG = SettingsFragment.class.getSimpleName();

    // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
    private static final String ARG_PARAM1 = "param1";
    private static final String ARG_PARAM2 = "param2";

    private String mParam1;
    private String mParam2;

    private View view;

    public SettingsFragment() {
        // Required empty public constructor
    }

    /**
     * Use this factory method to create a new instance of
     * this fragment using the provided parameters.
     *
     * @return A new instance of fragment SettingsFragment.
     */
    public static SettingsFragment newInstance() {
        SettingsFragment fragment = new SettingsFragment();
        Bundle args = new Bundle();
        fragment.setArguments(args);
        return fragment;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (getArguments() != null) {
            mParam1 = getArguments().getString(ARG_PARAM1);
            mParam2 = getArguments().getString(ARG_PARAM2);
        }
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // TODO: 设置Fragment页面
        view = inflater.inflate(R.layout.fragment_settings, container, false);
        initView();
        return view;
    }

    @Override
    protected void initView() {
        ButterKnife.bind(this, view);

        setUpActionBar();
    }

    @Override
    protected void setUpActionBar() {
        super.setUpActionBar();
        mTvActionBarTitle.setText(R.string.title_settings);
        mActionBar.getCustomView().findViewById(R.id.btn_add_device).setVisibility(View.INVISIBLE);
    }

    @Override
    protected void initData() {

    }

}
